#pragma once

#include "BmpBtn.h"
#include "../Util/PowerThread.h"

/** 
 *@brief  The system power state indicator
 */

class GUI_API CBatCtrl : public CBmpBtn
{
public:
	CBatCtrl(void);
	/**
	*@param[in]  nID		 Specifies the  ID       of the control
	*/
	CBatCtrl(UINT nID);
	/**
	*@param[in]  strCaption  Specifies the  caption  of the control 
	*@param[in]  nID		 Specifies the  ID       of the control
	*/
	CBatCtrl(wstring strCaption,UINT nID);
	/**
	*@param[in]  dwStyle Specifies the  style of the control
	*@li @c SWS_STATIC   static control without any vents
	*@li @c SBS_ACTIVE  
	*@li @c SBS_ROUND
	*@li @c SBS_RECT
	*@param[in]  strCaption  Specifies the  caption  of the control 
	*@param[in]  rc           Specifies the  position of the control
	*@param[in]  nID		 Specifies the  ID       of the control
	*/
	CBatCtrl(DWORD dwStyle, wstring strCaption,const CRect &rc, UINT nID);
	/**
	*@param[in]  dwStyle Specifies the  style of the control
	*@li @c SWS_STATIC   static control without any vents
	*@li @c SBS_ACTIVE  
	*@li @c SBS_ROUND
	*@li @c SBS_RECT
	*@param[in]  strCaption  Specifies the  caption  of the control 
	*@param[in]  x           Specifies the  position of the left side of the control
	*@param[in]  y           Specifies the  position of the top  side of the control
	*@param[in]  cx          Specifies the  position of the width of the control
	*@param[in]  cy          Specifies the  position of the control
	*@param[in]  nID		 Specifies the  ID       of the control
	*/
	CBatCtrl(DWORD dwStyle, wstring strCaption, int x, int y, int cx, int cy, UINT nID);

public:
	virtual ~CBatCtrl(void);

	/**
	*@brief Set the icon number that in the image list
	*@param[in] frameNum  Icon number in the image list
	*@return  No return value
	*/

	inline void SetFrameNum(int frameNum)
	{
		m_nIconNum = frameNum;
	}


	/**
	*@brief Specifies the system new power state
	*@param[in]  state Specifies the new system power state
	*@li @c POW_CRITICAL        The battery power in critical state,the system will auto suspend
	*@li @c POW_VLOW            The battery power is  <= 20%
	*@li @c POW_LOW             The battery power is  <= 40%
	*@li @c POW_NORMAL          The battery power is  <= 60%
	*@li @c POW_HIGH            The battery power is  <= 80
	*@li @c POW_VHIGH           The battery power is  <= 100%
	*@li @c POW_CHARGING        Charging state
	*@li @c POW_CHARGEFULL      Charging full
	*@li @c POW_UNKNOWN         Unknown system power state
    *@return No return value
	*/
	static void SetPWState(PowerStatusType state);

	virtual void Paint(CDC* pDC);

public:
	static PowerStatusType g_pwstate;

private:
	int     m_nIndex;

};
